<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="js/jquery.min.js"></script>
        <script src="js/data.js" type="text/javascript"></script>
        <script>
            startlink=0;
            played=-1;
            qare2=""
            function play(soraNumber,qar2obj){
                if(soraNumber==115){
                    soraNumber=1;
                }
                var site=qar2obj.link;
                qare2=qar2obj.id
                link=''
                if(soraNumber < 10){
                    link+="00"
                }
                else{
                    if(soraNumber<100){
                        link+="0"
                    }
                }
                link+=soraNumber
                startlink=link;
                site+=link+".mp3"
                document.getElementById("audio").src = site;
                document.getElementById("audio").load()
                document.getElementById("audio").play()
                played=1;
            }
            function pause(){
                played=0;
                document.getElementById("audio").pause()
            }
            function playpause(){
                document.getElementById("audio").play();
                played=1;
            }
            function ononplaying(){
                var popup=chrome.extension.getViews({
                    type:"popup"
                })
                if(popup.length!=0){
                    popup[0].popupPlayer.showwait();
                }
            }
            $(document).ready(function(){
                document.getElementById("audio").addEventListener('ended',function(){
                    startlink++;
                    play(startlink,quranQare2[qare2-1])
                },false)
            })
        </script>
    </head>
    <body>
    <audio id="audio" controls  onplaying="ononplaying()"></audio>
</body>
</html>
